package com.kylin.androidlearn1.acticity;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.kylin.androidlearn1.R;

/**
 * Created by kylinhuang on 10/3/16.
 */
public class DialogActicity  extends Activity{
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_dialog);


        /* Display a text message with yes/no buttons and handle each message as well as the cancel action */
        Button twoButtonsTitle = (Button) findViewById(R.id.two_buttons);
        twoButtonsTitle.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                AlertDialog.Builder build = new AlertDialog.Builder(DialogActicity.this);
                build.setTitle("title");
                build.setMessage("message");

                //
                build.setPositiveButton("OK", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {

                    }
                });

                build.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {

                    }
                });

                AlertDialog alertDialog =  build.create();
                alertDialog.show();
            }
        });

        /* Display a long text message with yes/no buttons and handle each message as well as the cancel action */
        Button twoButtons2Title = (Button) findViewById(R.id.two_buttons2);
        twoButtons2Title.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {

            }
        });


        /* Display an ultra long text message with yes/no buttons and handle each message as well as the cancel action */
        Button twoButtons2UltraTitle = (Button) findViewById(R.id.two_buttons2ultra);
        twoButtons2UltraTitle.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
            }
        });


        /* Display a list of items */
        Button selectButton = (Button) findViewById(R.id.select_button);
        selectButton.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
            }
        });

        /* Display a custom progress bar */
        Button progressButton = (Button) findViewById(R.id.progress_button);
        progressButton.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {

            }
        });

        /* Display a custom progress bar */
        Button progressSpinnerButton = (Button) findViewById(R.id.progress_spinner_button);
        progressSpinnerButton.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
            }
        });

        /* Display a radio button group */
        Button radioButton = (Button) findViewById(R.id.radio_button);
        radioButton.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
            }
        });

        /* Display a list of checkboxes */
        Button checkBox = (Button) findViewById(R.id.checkbox_button);
        checkBox.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
            }
        });

        /* Display a list of checkboxes, backed by a cursor */
        Button checkBox2 = (Button) findViewById(R.id.checkbox_button2);
        checkBox2.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {

            }
        });

        /* Display a text entry dialog */
        Button textEntry = (Button) findViewById(R.id.text_entry_button);
        textEntry.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
            }
        });

        /* Two points, in the traditional theme */
        Button twoButtonsOldSchoolTitle = (Button) findViewById(R.id.two_buttons_old_school);
        twoButtonsOldSchoolTitle.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
            }
        });

        /* Two points, in the light holographic theme */
        Button twoButtonsHoloLightTitle = (Button) findViewById(R.id.two_buttons_holo_light);
        twoButtonsHoloLightTitle.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
            }
        });

        /* Two points, in the light default theme */
        Button twoButtonsDefaultLightTitle = (Button) findViewById(R.id.two_buttons_default_light);
        twoButtonsDefaultLightTitle.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
            }
        });

        /* Two points, in the dark default theme */
        Button twoButtonsDefaultDarkTitle = (Button) findViewById(R.id.two_buttons_default_dark);
        twoButtonsDefaultDarkTitle.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
            }
        });


    }
}
